-- Important before executing:
-- Replace %table% with the tablename you specified in config.yml.
-- Example: If your table is called lb-main, then:
-- INSERT INTO `lb-main` ( [...]

INSERT INTO `%table%` ( `date` , `player` , `replaced` , `data` , `x` , `y` , `z` )
SELECT FROM_UNIXTIME( `date` ) AS `date` , `player` , `type` , `data` , `x` , `y` , `z`
FROM `bbdata`
WHERE `action` = 0 AND `world` = 0;

INSERT INTO `%table%` ( `date` , `player` , `type` , `data` , `x` , `y` , `z` )
SELECT FROM_UNIXTIME( `date` ) AS `date` , `player` , `type` , `data` , `x` , `y` , `z`
FROM `bbdata`
WHERE `action` = 1 AND `world` = 0;

INSERT INTO `%table%` ( `date` , `player` , `type` , `data` , `x` , `y` , `z` )
SELECT FROM_UNIXTIME( `date` ) AS `date` , `player` , 51 AS `type` , `data` , `x` , `y` , `z`
FROM `bbdata`
WHERE `action` = 14 AND `world` = 0;